package com.itheima.zixi5.duoxiancheng_chuangjian.method3;

import java.util.concurrent.Callable;

public class Mycallable implements Callable<String> {
    private int a;

    public Mycallable(int a) {
        this.a = a;
    }

    @Override
    public String call() throws Exception {
        int sum = 0;
        for (int i = 1; i <= a; i++) {
            sum += i;
        }
        return "线程计算结果为："+ sum;
    }
}
